package com.DHH.Service.Order.Impl;
import com.DHH.Entity.Order.OrderInfoStateRecord;
import com.DHH.Mapper.Order.OrderInfoStateRecordMapper;
import com.DHH.Service.Order.IOrderInfoStateRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderInfoStateRecordServiceImpl implements IOrderInfoStateRecordService{
	
	@Autowired
    private OrderInfoStateRecordMapper orderInfoStateRecordMapper;
    
   @Override
   public OrderInfoStateRecord insertOrderInfoStateRecord(OrderInfoStateRecord orderInfoStateRecord){
	   
        orderInfoStateRecordMapper.insertSelective(orderInfoStateRecord);
	   return orderInfoStateRecord;
	   
   };
   @Override
   public OrderInfoStateRecord updateOrderInfoStateRecord(OrderInfoStateRecord orderInfoStateRecord){
	     orderInfoStateRecordMapper.updateByPrimaryKeySelective(orderInfoStateRecord);
        return orderInfoStateRecord;
   };
   @Override
   public OrderInfoStateRecord deleteOrderInfoStateRecord(OrderInfoStateRecord orderInfoStateRecord){

	     orderInfoStateRecordMapper.delete(orderInfoStateRecord);
        return orderInfoStateRecord;
   };
    /**
     * 保存或更新操作，返回值为主表
     */
    public OrderInfoStateRecord saveOrUpdateOrderInfoStateRecord(OrderInfoStateRecord orderInfoStateRecord){
        if(orderInfoStateRecord.getId()==null)
        {
            orderInfoStateRecordMapper.insertSelective(orderInfoStateRecord);
        }else{
            orderInfoStateRecordMapper.updateByPrimaryKeySelective(orderInfoStateRecord);
        }
        return orderInfoStateRecord;
    };
}
